<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
<script type="text/javascript">
	var pageId;
	function doCreatePage(){
		pageId = document.getElementById("ds_host").value;
		if(JLUtil.doConfirm("确认生成页面的代码？")){
			JLAjax.ajaxJson("${ctx}/appFrameModule1/generatePageCode",
					{'pageId':pageId},createPageBack);
		}
	}
	
	// 执行生成生成页面后的回调函数
	function createPageBack(data){
		alert(data.em);
	}
	
	function doSavePage(){
		pageId = document.getElementById("ds_host").value;
		var pageName = document.getElementById("ds_name").value;
		JLAjax.ajaxJson("${ctx}/appFrameModule1/savePageRequest",
				{'pageId':pageId, 'pageName':pageName},function(data){alert(data.em);window.location.reload();});
	}
</script>
</head>
<body>
<form class="form-horizontal" role="form">
                       <div class="form-group">
                          <label class="col-xs-1 control-label" for="ds_host">页面标识</label>
                          <div class="col-xs-4">
                             <input class="input-sm form-control" id="ds_host" type="text" value="${SPageBase.pageId}" readonly/>
                          </div>
                          <label class="col-xs-1 control-label" for="ds_name">页面名称</label>
                          <div class="col-xs-4">
                             <input class="input-sm form-control" id="ds_name" type="text" value="${SPageBase.pageName}"/>
                          </div>
							 <div class="col-xs-2">
								<button type="button" class="btn btn-default btn-sm" onclick="doSavePage()">&nbsp;&nbsp;保&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存&nbsp;&nbsp;</button>
							</div>                             
                       </div>
                       <div class="form-group">
                          <label class="col-xs-1 control-label" for="ds_host">制作方式</label>
                          <div class="col-xs-4">
                             <input class="input-sm form-control" id="ds_host" type="text" value="${SPageBase.pageMakeMode}" readonly/>
                          </div>
                          <label class="col-xs-1 control-label" for="ds_name">使用模板</label>
                          <div class="col-xs-4">
                             <input class="input-sm form-control" id="ds_name" type="text" value="${SPageBase.templateId}" readonly/>
                          </div>
							 <div class="col-xs-2">
								<button type="button" class="btn btn-primary btn-sm" onclick="doCreatePage()">&nbsp;&nbsp;生成页面&nbsp;&nbsp;</button>
							</div>                             
                       </div>
                </form>

</body>
</html>
